<!DOCTYPE html>
<html lang="en">
<head>
    <title>大区报表</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <link rel="stylesheet" href="/dist/css/oa-app.css">
    <script src="https://file.ggxqce.com/web/vue.min.js"></script>
</head>
<style>
    body, html {
        width: 100%;
        margin: 0;
        font-family: "微软雅黑";
    }

    #allmap, #allmap2 {
        /*width: 100%;*/
        height: 300px;
        overflow: hidden;
        margin: 0;
        font-family: "微软雅黑";
    }

    [v-cloak] {
        display: none;
    }

    * {
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        font-size: 12px;
    }

    body {
        margin: 1px;
        background: #ffffff;
    }

    .boxBoy {
        background: #fff;
    }

    table {
        border-spacing: 0;
        border-collapse: collapse;
        display: table;
    }

    .weather {
        text-align: center;
        font-size: 16px;
        /*position: absolute;*/
        top: 5px;
        line-height: 30px;
        float: left;
    }

    th {
        font-weight: normal;
    }

    table.text-center, table.text-center td, table.text-center th {
        text-align: center;
        font-size: 12px;
        margin-top: -1px;
    }

    .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
        border: 1px solid #cbcbcd;
        height: 28px;
        position: relative;
        color: #333;
        padding: 0 4px;
    }

    table th {
        background: #f8f8f8;
    }

    .table-bordered {
        border: 1px solid #cbcbcd;
    }

    .table {
        width: 100%;
        max-width: 100%;
    }

    .hidden {
        display: none;
    }

    .lineOne, .lineTwo {
        text-align: left;
    }

    .tdColor {
        background-color: #f8f8f8;
        font-weight: normal;
    }

    .lineOne span {
        max-height: 24px;
        line-height: 24px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1;
        text-align: left;
    }

    .lineTwo span {
        max-height: 55px;
        line-height: 16px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        text-align: left;
        padding: 5px;

    }

    .div-td-content-more {
        position: absolute;
        height: auto;
        z-index: 999;
        line-height: 20px;
        background-color: #d3e8fd;
        padding: 8px 6px;
        border: 1px solid #e8e8ea;
        display: none;
    }

    .div-td-content-more i {
        width: 15px;
        height: 12px;
        background: url("/dist/img/more-icon.png");
        position: absolute;
        left: 50px;
        top: -12px;
    }

    .clear {
        clear: both
    }

    .boxItem {
        width: 100%;
        margin-top: 5px;
        background: inherit;
        /*background-color: rgba(255, 255, 255, 1);*/
        border: none;
        position: relative;
    }

    .boxItemTitle {
        color: #000;
        font-size: 22px;
        font-weight: bold;
        margin-bottom: 6px;
        text-align: center;
    }

    .home {
        font-size: 14px;
        font-weight: bold;
        margin-bottom: 10px;
        height: 14px;
        line-height: 14px;
        text-align: center;
    }

    .dian-icon {
        background: url("/dist/img/dian.png") no-repeat;
        background-size: cover;
        width: 14px;
        height: 14px;
        display: inline-block;
    }

    .jiaobiao, .jiaobiaoNew {
        position: relative;
    }

    .jiaobiao i {
        display: block;
        width: 0;
        height: 0;
        border-width: 0px 0 12px 12px;
        border-style: solid;
        border-color: transparent transparent transparent #2a8cec;
        position: absolute;
        top: 0px;
        left: 0px;
    }

    .jiaobiaoNew i {
        display: block;
        width: 12px;
        height: 12px;
        background: url("/dist/img/newLog2.png");
        background-size: 100% 100%;
        position: absolute;
        top: 0px;
        left: 0px;
    }

    .lineImg {
        padding-top: 5px !important;
        padding-bottom: 10px !important;
    }

    .lineImg img {
        height: 45px;
        width: 45px;
        float: left;
        margin: 10px;
        object-fit: cover;
    }

    .newCustomer {
        background: url(/dist/img/new.png) no-repeat;
        background-size: cover;
        width: 20px;
        height: 20px;
        right: 0;
        top: 2px;
        position: absolute;
    }

    .wajueji {
        padding-left: 140px;
        background: url("/dist/img/wajueji.png") no-repeat;
        background-size: 120px 88px;
        height: 88px;
        line-height: 88px;
        color: red;
        font-size: 14px;
        font-weight: bold;
        margin-left: 50px;
    }

    .qipao {
        /*background: url(/dist/img/qipao.png);*/
        background-size: 100% 100%;
        height: 88px;
        /* padding: 0 20px; */
        padding-left: 20px;
        /*padding-right: 20px;*/
        color: red;
        line-height: 88px;
        float: left;
        font-size: 14px;
        font-weight: bold;
    }

    .plan1 {
        background: url("/dist/img/plan1.png") no-repeat center center;
        background-size: 100%;
    }

    .plan2 {
        background: url("/dist/img/plan2.png") no-repeat center center;
        background-size: 100%;
    }

    .plan3 {
        background: url("/dist/img/plan3.png") no-repeat center center;
        background-size: 100%;
    }

    .boxItemTitleNotice {
        color: red;
        font-size: 22px;
        font-weight: bold;
        margin-bottom: 10px;
        text-align: center;
    }

    .boxItemTitleNotice i {
        background: url("/dist/img/jg.png") no-repeat center center;
        height: 22px;
        width: 22px;
        background-size: cover;
        display: inline-block;
        margin-bottom: -3px;
        margin-left: 5px;
    }

    .boxItemTitleNoticeTime {
        color: red;
        font-size: 20px;
        font-weight: bold;
        margin-bottom: 10px;
        text-align: center;
    }

    .boxItemTitleNoticeTime i {
        background: url("/dist/img/jg.png") no-repeat center center;
        height: 16px;
        width: 16px;
        background-size: cover;
        display: inline-block;
        margin-bottom: -3px;
        margin-left: 5px;
    }

    .search-button {
        width: 14px;
        height: 14px;
        background-image: url(/dist/img/glass.jpg);
        border: 0 none;
        cursor: pointer;
        margin-top: 0px;
    }

    input[type=button] {
        outline: none;
    }

    .oaBtn {
        background: url(/dist/img/btn-bj2.png) repeat-y !important;
        background-size: 100% 100% !important;
        color: #fff !important;
    }

    .btn-group-sm > .btn, .btn-sm {
        padding: 2px 10px;
    }

    .btn {
        border-radius: 3px;
        -webkit-box-shadow: none;
        box-shadow: none;
        border: 1px solid transparent;
    }

    .pull-right {
        float: right !important;
    }

    .blue {
        color: #39c;
    }

    .red {
        color: #e03800;
    }

    .weather img {
        height: 30px;
        width: 30px;
        float: left;
    }

    .templateStyle {
        margin-top: 15px;
        margin-left: 10px;
        margin-right: 10px;
    }

</style>
<body>
<section class="content" id="app" v-cloak>
    <div class="div-td-content-more"><i></i></div>
    <div class="templateStyle" style="margin-top: 10px;">
        <div class="boxItem">
            <div class="boxBoy">
                <table class="table table-bordered text-center table-width">
                    <tbody>
                    <tr>
                        <td colspan="4" class="tableTitle">团队建设</td>
                    </tr>
                    <tr>
                        <td class="tdColor" style="width: 25%;">区域</td>
                        <td class="tdColor" style="width: 25%;">姓名</td>
                        <td class="tdColor" style="width: 25%;">当日罚款</td>
                        <td class="tdColor" style="width: 25%;">当月罚款</td>
                    </tr>
                    <tr v-for="(item,i) in team">
                        <td>{{item.regionName}}</td>
                        <td>{{item.userName}}</td>
                        <td v-if="item.todayMoney>0" style="color: #2a8cec;cursor: pointer;"
                            @click="openDetail(dateTime,item.userName,item.companyId,item.regionId,item.userId,item.roleName)">
                            {{item.todayMoney}}
                        </td>
                        <td v-else>
                            {{item.todayMoney==0?'-':item.todayMoney}}
                        </td>
                        <td v-if="item.money>0" style="color: #2a8cec;cursor: pointer;"
                            @click="openDetail(dateTime.substring(0,7),item.userName,item.companyId,item.regionId,item.userId,item.roleName)">
                            {{item.money}}
                        </td>
                        <td v-else>
                            {{item.money==0?'-':item.money}}
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div class="templateStyle" style="margin-top: 10px;" v-if="isZongJian==1">
        <div class="boxItem">
            <div class="boxBoy">
                <table class="table table-bordered text-center table-width">
                    <tbody>
                    <tr>
                        <td colspan="3" class="tableTitle">陪跑报表</td>
                    </tr>
                    <tr>
                        <td class="tdColor" style="width: 33.3%;">区域</td>
                        <td class="tdColor" style="width: 33.3%;">姓名</td>
                        <td class="tdColor" style="width: 33.3%;">数量</td>
                    </tr>
                    <tr v-for="(item,i) in run">
                        <td>{{item.regionName}}</td>
                        <td>{{item.userName}}</td>
                        <td v-if="item.num==''">-</td>
                        <td v-else style="color: #2a8cec;"
                            @click="openReportDetail('run',month,item.userId)">
                            {{item.num}}
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div class="templateStyle">
        <div class="boxItem">
            <div class="boxBoy">
                <table class="table table-bordered text-center table-width">
                    <tr>
                        <td colspan="3" style="line-height: 28px;" class="tableTitle">面访客户<button v-if="showCaptureBtn" style="position:absolute;right: 5px;padding:2px;top: 1px;" @click="openReport(1)">报表截图</button>
                        </td>

                    </tr>
                    <tr>
                        <td class="tdColor" style="width: 33.3%;">区域</td>
                        <td class="tdColor" style="width: 33.3%;">姓名
                        </td>
                        <td class="tdColor" style="width: 33.3%;">完成</td>
                    </tr>
                    <tr v-for="(item,i) in faceCustomer">
                        <td class="lineOne"><span>{{item.regionName}}</span></td>
                        <td>{{item.userName?item.userName:'-'}}</td>
                        <td v-if="item.num==''">-</td>
                        <td v-else style="color: #2a8cec;"
                            @click="openReportDetail('faceCustomer',month,item.userId)">{{item.num}}
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">合计</td>
                        <td>{{faceCustomer.finishCount}}</td>
                    </tr>
                </table>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div class="templateStyle">
        <div class="boxItem">
            <div class="boxBoy">
                <table class="table table-bordered text-center table-width">
                    <tr>
                        <td colspan="3" style="line-height: 28px;" class="tableTitle">电访客户
                            <button v-if="showCaptureBtn" style="position:absolute;right: 5px;padding:2px;top: 1px;" @click="openReport(0)">报表截图</button>
                        </td>
                    </tr>
                    <tr>
                        <td class="tdColor" style="width: 33.3%;">区域</td>
                        <td class="tdColor" style="width: 33.3%;">姓名
                        </td>
                        <td class="tdColor" style="width: 33.3%;">完成</td>
                    </tr>
                    <tr v-for="(item,i) in telCustomer">
                        <td class="lineOne"><span>{{item.regionName}}</span></td>
                        <td>{{item.userName?item.userName:'-'}}</td>
                        <td v-if="item.num==''">-</td>
                        <td v-else style="color: #2a8cec;"
                            @click="openReportDetail('telCustomer',month,item.userId)">{{item.num}}
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">合计</td>
                        <td>{{telCustomer.finishCount}}</td>
                    </tr>
                </table>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div class="templateStyle">
        <div class="boxItem">
            <div class="boxBoy">
                <table class="table table-bordered text-center table-width">
                    <tbody>
                    <tr>
                        <td colspan="4" class="tableTitle">客户管理</td>
                    </tr>
                    <tr>
                        <td class="tdColor" style="width: 25%;">姓名</td>
                        <td class="tdColor" style="width: 25%;">区域</td>
                        <td class="tdColor" style="width: 25%;">本月新增</td>
                        <td class="tdColor" style="width: 25%;">总数量</td>
                    </tr>
                    <tr v-for="(item,i) in customer">
                        <td :rowspan="item.userNamespan" :class="{hidden: item.userNamedis}">
                            {{item.userName}}
                        </td>
                        <td class="lineOne">
                            <span style="text-align: center;">{{item.countyName}}</span>
                        </td>
                        <td v-if="item.newNum>0" style="color: #2a8cec;cursor: pointer;"
                            @click="openReportDetail2('monthNewCustomer',today,item.userId,item.countyName,0)">
                            {{item.newNum}}
                        </td>
                        <td v-else-if="item.newNum==''">
                            0
                        </td>
                        <td v-else>
                            {{item.newNum}}
                        </td>
                        <td v-if="item.sunNum>0" style="color: #2a8cec;cursor: pointer;"
                            @click="openReportDetail2('allCustomer2',month,item.userId,item.countyName,1)">
                            {{item.sunNum}}
                        </td>
                        <td v-else-if="item.sunNum==''">
                            0
                        </td>
                        <td v-else>
                            {{item.sunNum}}
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div class="templateStyle">
        <div class="boxItem">
            <div class="boxBoy">
                <table class="table table-bordered text-center table-width">
                    <tbody>
                    <tr>
                        <td colspan="7" class="tableTitle">销售目标及意向客户</td>
                    </tr>
                    <tr>
                        <td class="tdColor" style="width: 14.2%;">姓名</td>
                        <td class="tdColor" style="width: 14.2%;">目标</td>
                        <td class="tdColor" style="width: 14.2%;">一月内</td>
                        <td class="tdColor" style="width: 14.2%;">一月<br>以上</td>
                        <td class="tdColor" style="width: 14.2%;">已完成</td>
                        <td class="tdColor" style="width: 14.2%;">罚款<br>金额</td>
                        <td class="tdColor" style="width: 14.2%;">奖励<br>金额</td>
                    </tr>
                    <tr v-for="(item,i) in targetAndYX">
                        <td>{{item.userName}}</td>
                        <td>{{item.targetNum}}</td>
                        <td v-if="item.withinOneMonth==0">{{item.withinOneMonth}}</td>
                        <td v-else style="color: #2a8cec;"
                            @click="openMonth('withMonth',today,item.userId)">
                            {{item.withinOneMonth}}
                        </td>
                        <td v-if="item.moreThanOneMonth==0">{{item.moreThanOneMonth}}</td>
                        <td v-else style="color: #2a8cec;"
                            @click="openMonth('moreMonth',today,item.userId)">
                            {{item.moreThanOneMonth}}
                        </td>
                        <td>{{item.finishNum}}</td>
                        <td v-if="item.salePunishment==0">
                            {{item.salePunishment}}
                        </td>
                        <td v-else style="cursor: pointer;color: #2a8cec;"
                            @click="openAward('0',today,item.userId)">
                            {{item.salePunishment}}
                        </td>
                        <td v-if="item.saleReward==0">
                            {{item.saleReward}}
                        </td>
                        <td v-else style="cursor: pointer;color: #2a8cec;"
                            @click="openAward('1',today,item.userId)">
                            {{item.saleReward}}
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div class="templateStyle" style="margin-bottom: 15px;">
        <div class="boxItem">
            <div class="boxBoy">
                <table class="table table-bordered text-center table-width">
                    <tbody>
                    <tr>
                        <td colspan="6" class="tableTitle">微信转发及好友数</td>
                    </tr>
                    <tr>
                        <td class="tdColor" style="width: 16.6%;">姓名</td>
                        <td class="tdColor" style="width: 16.6%;">应转发</td>
                        <td class="tdColor" style="width: 16.6%;">已转发</td>
                        <td class="tdColor" style="width: 16.6%;">未转发</td>
                        <td class="tdColor" style="width: 16.6%;">好友数</td>
                        <td class="tdColor" style="width: 16.6%;">今日<br/>新增</td>
                    </tr>
                    <tr v-for="(item,i) in wechat">
                        <td>{{item.userName}}</td>
                        <td>{{item.forward}}</td>
                        <td>{{item.finishForward}}</td>
                        <td style="color: red;" @click="openWechat('2',today,item.userId)">
                            {{item.noForward}}
                        </td>
                        <td>{{item.contacts}}</td>
                        <td>{{Math.abs(item.num)}}</td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div class="templateStyle" style="margin-bottom: 15px;" v-if="isZongJian==1">
        <div class="boxItem">
            <div class="boxBoy">
                <table class="table table-bordered text-center table-width">
                    <tbody>
                    <tr>
                        <td colspan="4" class="tableTitle">费用报表</td>
                    </tr>
                    <tr>
                        <td class="tdColor" style="width: 25%;">姓名</td>
                        <td class="tdColor" style="width: 25%;">金额</td>
                        <td class="tdColor" style="width: 25%;">已报销</td>
                        <td class="tdColor" style="width: 25%;">未报销</td>
                    </tr>
                    <tr v-for="(item,i) in cost">
                        <td>{{item.userName}}</td>
                        <td>{{item.money}}</td>
                        <td>{{item.bxMoney}}</td>
                        <td>{{item.unBxMoney}}</td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="clear"></div>
        </div>
    </div>
</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="/dist/plugins/scroll/myScroll.js"></script>
<!--框架已定义 JS-->
<!--oa自定义  JS-->
<script src="/dist/js/oaApp.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne,.lineTwo", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script>
    $.ajaxSetup({
        global: true,
        type: "POST",
        cache: false,
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        beforeSend: function () {
        },
        complete: function () {

        },
        error: function (e) {
            alert('error' + e.responseText);
        }
    });
    $.extend($.wyui, {
        postMethod: function (url, data, callback, sync, id) {
            if (!id) {
                id = "#app"
            }
            $.ajax({
                url: server.ip + url,
                async: sync ? false : true,
                data: JSON.stringify(data),
                beforeSend: function () {

                },
                complete: function () {
                    setTimeout(function () {
                    }, 1000);

                },
                success: function (r) {
                    if (!r.e.code) {
                        callback(r.data.sendData);
                    } else {
                        alert(r.e.desc);
                    }
                },
                error: function (e) {
                    alert(url + e.responseText);
                }
            });
        },
    });
</script>
<script type="text/javascript">
    var app = new Vue({
        el: "#app",
        data: {
            userId: getUrlParamObj().userId,
            regionId: getUrlParamObj().departId,
            dateTime: getUrlParamObj().dateTime,
            isZongJian: getUrlParamObj().isZongJian,
            companyId: getUrlParamObj().companyId,
            month: new Date().Format('yyyy-MM'),
            today: new Date().Format('yyyy-MM-dd'),
            team: [],
            run: [],
            faceCustomer: [],
            telCustomer: [],
            targetAndYX: [],
            customer: [],
            wechat: [],
            cost: [],
            showCaptureBtn: false
        },
        methods: {
            //合并单元格
            tablesMergeCell: function (list) {
                for (field in list[0]) {
                    var k = 0;
                    while (k < list.length) {
                        list[k][field + 'span'] = 1;
                        list[k][field + 'dis'] = false;
                        for (var i = k + 1; i <= list.length - 1; i++) {
                            if (list[k][field] == list[i][field] && list[k][field] != '') {
                                list[k][field + 'span']++;
                                list[k][field + 'dis'] = false;
                                list[i][field + 'span'] = 1;
                                list[i][field + 'dis'] = true;
                            } else {
                                break;
                            }
                        }
                        k = i;
                    }
                }
                return list;
            },
            //获取合计
            getCount: function (arr, key) {
                var number = 0;
                for (var i = arr.length - 1; i >= 0; i--) {
                    number += (arr[i][key] && arr[i][key] != '-' ? arr[i][key] : 0)

                }
                return number;
            },
            //获取团队建设
            get_team: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.newDaQuReportForm.getTeamBuildingForBRM, {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                    "regionId": that.regionId
                }, function (data) {
                    console.log(data.records)
                    that.team = data.records;
                });
            },
            //获取陪跑报表
            get_run: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.newDaQuReportForm.daQuVisit, {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                    "regionId": that.regionId
                }, function (data) {
                    console.log(data.records)
                    that.run = data.records;
                });
            },
            //获取面访电访
            get_faceCustomer: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.newDaQuReportForm.getVisitCustomerByUserIdAndDateTimeForBRM, {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                    "type": '1',
                    "regionId": that.regionId
                }, function (data) {
                    console.log(data.records)
                    that.faceCustomer = data.records;
                    that.faceCustomer.finishCount = that.getCount(that.faceCustomer, "num");
                });
                $.wyui.postMethod(urlConfig.newDaQuReportForm.getVisitCustomerByUserIdAndDateTimeForBRM, {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                    "type": '0',
                    "regionId": that.regionId
                }, function (data) {
                    console.log(data.records)
                    that.telCustomer = data.records;
                    that.telCustomer.finishCount = that.getCount(that.telCustomer, "num");
                });
            },
            //获取销售目标及意向客户
            get_targetAndYX: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.newDaQuReportForm.getSaleForBRM, {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                    "regionId": that.regionId
                }, function (data) {
                    console.log(data.records)
                    that.targetAndYX = data.records;
                });
            },
            //获取客户管理
            get_customer: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.newDaQuReportForm.getCustomerNumByUserIdAndDateTimeForBRM, {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                    "regionId": that.regionId
                }, function (data) {
                    console.log(data.records)
                    that.customer = that.tablesMergeCell(data.records);
                });
            },
            //获取微信好友
            get_wechat: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.newDaQuReportForm.getWechatShareListForBRM, {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                    "regionId": that.regionId
                }, function (data) {
                    console.log(data.records)
                    that.wechat = data.records;
                });
            },
            //获取费用报表
            get_cost: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.newDaQuReportForm.getCostListByUserId, {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                    "regionId": that.regionId
                }, function (data) {
                    console.log(data.records)
                    that.cost = data.records;
                });
            },
            /*获取罚款明细*/
            openDetail: function (dateTime, userName, companyId, bigRegionId, userId, roleName) {
                var that = this;
                var obj = {
                    type: 'customerList',
                    url: '/reportForm/newReportForm/detailApp.html?dateTime=' + dateTime + '&companyId=' + companyId + '&bigRegionId=' + bigRegionId + '&userId=' + userId + '&userName=' + userName + '&roleName=' + roleName,
                    id: userId,
                    name: userName,
                    dateTime: dateTime
                }
                prompt(JSON.stringify(obj))
            },
            /*打开报表*/
            openReport: function (type) {
                var that = this;
                var obj = {
                    type: 'openWeb',
                    url: '/page/reportForm/newReportForm/daQuinterviewReport2App.html?dateTime=' + that.dateTime + '&companyId=' + that.companyId + '&bigRegionId=' + that.bigRegionId + '&userId=' + that.userId + '&userName=' + that.userName + '&roleName=' + that.roleName + '&type=' + type,
                    name: '',
                    dateTime: that.dateTime,
                    screenType: '1'
                }
                console.log(obj.url)
                prompt(JSON.stringify(obj))
            },
            //跳转到详情页
            openReportDetail: function (type, today, userId) {
                var obj = {
                    type: 'customerList',
                    url: '/reportForm/newReportForm/quYuReportDetailApp.html?userId=' + userId + '&type=' + type + '&dateTime=' + this.dateTime.substring(0, 7),
                    name: '客户列表'
                }
                prompt(JSON.stringify(obj))
            },
            //客户管理跳转到详情页
            openReportDetail2: function (type, today, userId,countyName,state) {
                var obj = {
                    type: 'customerList',
                    url: '/reportForm/newReportForm/customerListApp.html?userId=' + userId + '&type=' + type + '&dateTime=' + this.dateTime.substring(0, 7)+'&countyName='+countyName+'&state='+state,
                    name: '客户列表'
                }
                prompt(JSON.stringify(obj))
            },
            //跳转到奖惩详情
            openAward: function (type, today, userId) {
                var obj = {
                    type: 'customerList',
                    url: '/reportForm/newReportForm/daQuTargetDetailApp.html?userId=' + userId + '&type=' + type + '&dateTime=' + this.dateTime,
                    name: '奖惩列表'
                }
                prompt(JSON.stringify(obj))
            },
            //跳转到奖惩详情
            openMonth: function (type, today, userId) {
                var obj = {
                    type: 'customerList',
                    url: '/reportForm/newReportForm/quYuReportDetailApp.html?userId=' + userId + '&type=' + type + '&dateTime=' + this.dateTime,
                    name: '客户列表'
                }
                prompt(JSON.stringify(obj))
            },
            //跳转到微信详情页
            openWechat: function (type, today, userId) {
                var obj = {
                    type: 'customerList',
                    url: '/reportForm/newReportForm/daQuWeChatDetailApp.html?userId=' + userId + '&type=' + type + '&dateTime=' + this.dateTime,
                    name: '微信详情'
                }
                prompt(JSON.stringify(obj))
            },
            //获取权限
            get_roleName: function () {
                var that = this;
                var dialog = {
                    dialog: 'show'
                }
                prompt(JSON.stringify(dialog))
                $.wyui.postMethod(urlConfig.newZXQReportForm.getRoleNameByUserId, {
                    "userId": that.userId,
                }, function (data) {
                    var roleName = data.records;
                    if ('区域支持' == roleName || '销售管理' == roleName  || '后台管理' == roleName  || '集团销售管理' == roleName || '办事处支持' == roleName || '销售支持' == roleName || '销售管理经理' == roleName || '人事专员' == roleName || '服务支持' == roleName) {
                        //显示截图按钮
                        that.showCaptureBtn = true
                    }
                    that.get_team();
                    that.get_run();
                    that.get_faceCustomer();
                    that.get_targetAndYX();
                    that.get_customer();
                    that.get_wechat();
                    that.get_cost();
                    var dialog = {
                        dialog: 'hidden'
                    }
                    prompt(JSON.stringify(dialog))
                });

            },
        },
        mounted: function () {
            var that = this;
            that.get_roleName();
        }
    })
</script>
</body>
</html>